﻿using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Http;

namespace Link_eLab.Helper
{
    public class JwtTokenHelper
    {
        private static IHttpContextAccessor Accessor;
        public static void SetHttpContextAccessor(IHttpContextAccessor accessor)
        {
            Accessor = accessor;
        }

        public static object GetUserInfo()
        {
            HttpContext context = Accessor.HttpContext;
            var schemeProvider = context.RequestServices.GetService(typeof(IAuthenticationSchemeProvider)) as IAuthenticationSchemeProvider;
            return Accessor.HttpContext.User;
        }
    }
}